package org.syyo.admin.common.config;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.syyo.admin.common.interceptor.AuthorityInterceptor;

/**
 * @Auther: wangzhong
 * @Date: 2019/7/29 16:29
 * @Description:
 */
@Configuration
@ComponentScan(value="org.syyo.admin.common.interceptor")    //扫描拦截器所在的包
public class WebAppConfig implements WebMvcConfigurer {

    private AuthorityInterceptor authorityInterceptor;

    @Autowired
    public WebAppConfig(AuthorityInterceptor authorityInterceptor) {
        this.authorityInterceptor = authorityInterceptor;

    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
//        registry.addInterceptor(authorityInterceptor).addPathPatterns("/**")   //拦截所有
//                .excludePathPatterns("/user/login","/user/logout")
//                .excludePathPatterns("/app/**");

    }
}
